<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>                         
        
        <?php echo $html->css('mystyle.css'); ?>	
        
        <?php e($javascript->link('prototype.js')); ?>
        <?php e($javascript->link('scriptaculous.js')); ?>
        <?php e($javascript->link('richtext.js')); ?>
        

    <title> IT-jobz.com - Menyediakan Pekerjaan dan Sumber Daya Manusia di Bidang IT </title>
    <?php e($scripts_for_layout); ?>  
      
<?php
        if(isset($_SESSION['key']))
        { unset($_SESSION['key']); }
                                                     
        $baseurl = current(split("index", $_SERVER['SCRIPT_FILENAME']));  
        $file = $baseurl."count.txt";
        $size = filesize($file);
        $open = fopen($file, "r");
        $count = fread($open, $size);

        $expval = explode("*-*",$count);
        fclose($open);

        $file1 = $baseurl."ip.txt";
        $lines = file($file1);
        foreach ($lines as $line_num => $line)
        {
            $firstPos = strpos($line,'"');
            $secPos = strpos($line,'"');
            $ddate = substr($line,$firstPos+1,($secPos-$firstPos)-2);
            break;
        }

        $dat = date('d');
        $rip = $_SERVER['REMOTE_ADDR'];
        if($dat != $ddate)
        {
            $open2 = fopen($file1, "w");
            fwrite($open2, "DATE= \"$dat\"");
            fwrite($open2, "\n\n$rip");
            fclose($open2);

            $open = fopen($file, "w");
            fwrite($open, '1');
            fwrite($open,"*-*");
            fwrite($open,$expval[1]+$expval[0]);
            fwrite($open,"*-*");
            fwrite($open,$expval[2]+1);
            fclose($open);
        }
        else
        {
            $open2 = fopen($file1, "r");
            $size = filesize($file1);
            $ips = fread($open2, $size);

            if(!strpos($ips,$rip))
            {
                $open = fopen($file, "w");
                fwrite($open, $expval[0]+1);
                fwrite($open,"*-*");
                fwrite($open,$expval[1]);
                fwrite($open,"*-*");
                fwrite($open,$expval[2]);                
                fclose($open);

                $open3 = fopen($file1, "a");
                fwrite($open3,"\n\n");
                fwrite($open3, $rip);
                fclose($open3);
            }
            fclose($open2);
        }
?>    

</head>


<body>
    <div id="container">

        <div id="header">
            &nbsp
        </div>
        

        <div id='menu'>
        <div class="menu1">                     
            <?php 
            
                $menu1['normal'] = "menu_normal1";
                $menu1['click'] = "menu_click1";
                $menu1['link']['1']['text'] = "Indeks";
                $menu1['link']['1']['controller'] = "jobs";
                $menu1['link']['1']['action'] = "index";
                
                $menu1['link']['2']['text'] = "Pencarian Lowongan";
                $menu1['link']['2']['controller'] = "jobs";
                $menu1['link']['2']['action'] = "search";

                $menu1['link']['3']['text'] = "Pencari Kerja";
                $menu1['link']['3']['controller'] = "jobseekers";
                $menu1['link']['3']['action'] = "login";
                
                $menu1['link']['4']['text'] = "Perusahaan";
                $menu1['link']['4']['controller'] = "employers";
                $menu1['link']['4']['action'] = "login";

                $menu1['link']['5']['text'] = "Layanan karir";
                $menu1['link']['5']['controller'] = "articles";
                $menu1['link']['5']['action'] = "index";
                
                $menu1['link']['6']['text'] = "Testimonial";
                $menu1['link']['6']['controller'] = "testimonials";
                $menu1['link']['6']['action'] = "index";

                
                /*
                $menu1['link']['5']['text'] = "Service & Products";
                $menu1['link']['5']['controller'] = "advs";
                $menu1['link']['5']['action'] = "index";
                
                $menu1['link']['6']['text'] = "Career Service";
                $menu1['link']['6']['controller'] = "services";
                $menu1['link']['6']['action'] = "index";
                
                $menu1['link']['7']['text'] = "Testimonial";
                $menu1['link']['7']['controller'] = "testimonials";
                $menu1['link']['7']['action'] = "index";
                */
                
                
                $menu2['normal'] = "menu_normal2";
                $menu2['click'] = "menu_click2";
                $menu2['jobseekers']['1']['text']= "Indeks saya";
                $menu2['jobseekers']['1']['controller']= "jobseekers";
                $menu2['jobseekers']['1']['action']= "index";
                
                $menu2['jobseekers']['2']['text']= "Resume saya";
                $menu2['jobseekers']['2']['controller']= "jobseekers";
                $menu2['jobseekers']['2']['action']= "view_resume";
                
                $menu2['jobseekers']['3']['text']= "Assistant saya";
                $menu2['jobseekers']['3']['controller']= "assistants";
                $menu2['jobseekers']['3']['action']= "index";                
                
                $menu2['jobseekers']['4']['text']= "Rekomendasi Pekerjaan";
                $menu2['jobseekers']['4']['controller']= "assistants";
                $menu2['jobseekers']['4']['action']= "result";
                
                $menu2['jobseekers']['5']['text']= "Applications";
                $menu2['jobseekers']['5']['controller']= "applicants";
                $menu2['jobseekers']['5']['action']= "my_applications";
                
                $menu2['jobseekers']['6']['text']= "Simpan lowongan";
                $menu2['jobseekers']['6']['controller']= "clipboards";
                $menu2['jobseekers']['6']['action']= "my_clipboards";                
                
                $menu2['jobseekers']['7']['text']= "Edit Akun";
                $menu2['jobseekers']['7']['controller']= "jobseekers";
                $menu2['jobseekers']['7']['action']= "edit_account";

                $menu2['jobseekers']['8']['text']= "Keluar";
                $menu2['jobseekers']['8']['controller']= "jobseekers";
                $menu2['jobseekers']['8']['action']= "logout";
                                
                $menu2['employers']['1']['text']= "Indeks saya";
                $menu2['employers']['1']['controller']= "employers";
                $menu2['employers']['1']['action']= "index";
                
                $menu2['employers']['2']['text']= "Lowongan saya";
                $menu2['employers']['2']['controller']= "jobs";
                $menu2['employers']['2']['action']= "my_jobs";
                
                $menu2['employers']['3']['text']= "Iklan saya";
                $menu2['employers']['3']['controller']= "advs";
                $menu2['employers']['3']['action']= "my_advs";                
                
                $menu2['employers']['4']['text']= "Resumes Alert";
                $menu2['employers']['4']['controller']= "applicants";
                $menu2['employers']['4']['action']= "alert";                
                
                $menu2['employers']['5']['text']= "Cari Resume";
                $menu2['employers']['5']['controller']= "resumes";
                $menu2['employers']['5']['action']= "search";                
                
                $menu2['employers']['6']['text']= "Profil Perusahaan";
                $menu2['employers']['6']['controller']= "employers";
                $menu2['employers']['6']['action']= "company_profile";                
                
                $menu2['employers']['7']['text']= "Edit Akun";
                $menu2['employers']['7']['controller']= "employers";
                $menu2['employers']['7']['action']= "edit_account";  
                
                $menu2['employers']['8']['text']= "Keluar";
                $menu2['employers']['8']['controller']= "employers";
                $menu2['employers']['8']['action']= "logout";  


                if(empty($choose1))
                { $choose1=1; }
                
                if( $choose1 > 30 && $choose1 <40)
                { 
                    $choose2=$choose1-30;
                    $choose1=3;  
                }
                if( $choose1 > 40 )
                { 
                    $choose2=$choose1-40;
                    $choose1=4;  
                }
                                
                
                echo " <table class='table_menu1' cellspacing='0px'><tr height='28px'>";
                for ($i=1;$i<=count($menu1['link']);$i++)
                {
                    if($choose1==$i)
                    { echo "<td class='left_click1'></td><td class='".$menu1['click']."' valign='bottom'>".$menu1['link'][$i]['text']."</td><td class='right_click1'></td>"; }
                    else
                    { echo "<td class='left_normal1'></td><td class='".$menu1['normal']."' valign='bottom'>".$html->link($menu1['link'][$i]['text'],array('controller'=>$menu1['link'][$i]['controller'],'action'=>$menu1['link'][$i]['action']))."</td><td class='right_normal1'></td>";  }
                }  
                echo "</tr></table>";
                echo "<hr color='#6432fa'>";            
                echo "<hr color='#6432fa'>";            
            ?>
        </div>

        <div class='menu2'>
        <?php
                if(!empty($choose2))
                {
                    echo " <table class='table_menu2' cellspacing='0px'><tr height='28px'><td>";
                    if($choose1==3)
                    {
                        for($i=1;$i<=count($menu2['jobseekers']);$i++)
                        {
                            if($choose2==$i)
                            { echo "<span class='".$menu2['click']."'><u>".$html->link($menu2['jobseekers'][$i]['text'],array('controller'=>$menu2['jobseekers'][$i]['controller'],'action'=>$menu2['jobseekers'][$i]['action']),array('class'=>$menu2['click']))."</u></span>"; }
                            else
                            { echo "<span class='".$menu2['normal']."'>".$html->link($menu2['jobseekers'][$i]['text'],array('controller'=>$menu2['jobseekers'][$i]['controller'],'action'=>$menu2['jobseekers'][$i]['action']))."</span>";  }
                            if($i!=8)
                            { echo "<font color='white'> | </font>"; }
                        }                    
                    }
                    
                    if($choose1==4)
                    {
                        for($i=1;$i<=count($menu2['employers']);$i++)
                        {
                            if($choose2==$i)
                            { echo "<span class='".$menu2['click']."'><u>".$html->link($menu2['employers'][$i]['text'],array('controller'=>$menu2['employers'][$i]['controller'],'action'=>$menu2['employers'][$i]['action']),array('class'=>$menu2['click']))."</u></span>"; }
                            else
                            { echo "<span class='".$menu2['normal']."'>".$html->link($menu2['employers'][$i]['text'],array('controller'=>$menu2['employers'][$i]['controller'],'action'=>$menu2['employers'][$i]['action']))."</span>";  }
                            if($i!=8)
                            { echo "<font color='white'> | </font>"; } 
                        }                    
                    }
                    echo "</td></tr></table>";
                }
                else
                {
                    echo $this->Element('search_jobs');                 
                }
        ?>
        </div>
        
        </div>

        <div id="content">
            <?php 
                if ($session->check('Message.flash')):
                    $session->flash();
                endif;
	        echo $content_for_layout; 
            ?>
        </div>
        
        <div id="footer">
            COPYRIGHT @ 2013. ALL RIGHTS RESERVED.<br><a href="ymsgr:sendim?kawie_getho" border="0">
<img src="http://opi.yahoo.com/online?u=kawie_getho&t=2">
            
</a>
        </div>
    </div>
</body>

</html>
